/*
 *  Arrow
 *
 *  Created by David Giovannini on 1/5/07.
 *  Copyright 2007 Software by Jove. All rights reserved.
 *
 */
 
#ifndef SBJ_Arrow_IDispatcher_h
#define SBJ_Arrow_IDispatcher_h
 
#include "SBJ/Arrow/Topic.h"
#include "SBJ/Arrow/IRouter.h"
#include "SBJ/Arrow/DispatchStats.h"

#include <boost/shared_ptr.hpp>

namespace SBJ
{

namespace Arrow
{

class Subscription;

class IDispatcher : public IRouter
{
public:
	typedef boost::shared_ptr< IDispatcher > Ptr;
	typedef DispatchStats::Result Stats;

	// Must override IRouter::onMessage

	/// Override to add a subscription
	virtual bool subscribe( const Subscription& subscription ) = 0;
	
	/// Override to remove a subscription
	virtual bool unsubscribe( const Subscription& subscription ) = 0;

	/// Return the stats for this dispatcher
	virtual Stats getDispatchStats( void ) const { return DispatchStats().getResults(); }

	/// Resets the stats for this dispatcher
	virtual void resetStats( void ) {}
};

}

}

#endif